

        <g:set var="entityName" value="${message(code: 'post.label', default: 'Post')}" />
             <g:form action="save" method="post" name="createPost">
                
                <g:ifAnyGranted role="ROLE_STUDENT">
                    <g:hiddenField name="roletype" value="2" />
                </g:ifAnyGranted>
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="title"><g:message code="post.title.label" default="Title" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: postInstance, field: 'title', 'errors')}">
                                    <g:textField name="title" maxlength="50" value="${postInstance?.title}" />
                                </td>
                            </tr>
                        
                             <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="courses"><g:message code="student.courses.label" default="Courses" /></label>
                                </td>
                                <td valign="top">
                                    <g:each in="${org.grails.plugins.lookups.Lookup.idList('courses')}" status="i" var="courseInstance">
                                        ${courseInstance.value}<g:checkBox name="courses" checked="false" class="checkbox" value="${courseInstance.value}" />
                                    </g:each>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="needSex"><g:message code="student.needSex.label" default="Need Sex" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: postInstance, field: 'needSex', 'errors')}">
                                    <g:radioGroup class="radio" name="needSex" labels="['男','女','不限']"  values="['男','女','不限']" value="不限" >
                                        ${it.label} ${it.radio}
                                    </g:radioGroup>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="content"><g:message code="post.content.label" default="Content" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: postInstance, field: 'content', 'errors')}">
                                    <g:textArea name="content" cols="40" rows="5" value="${postInstance?.content}" />
                                </td>
                            </tr>
                                                
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>